package com.gscitysfy.cus.drain.modules.inspection.controller;

import com.gscitysfy.cloudfrmwk.assistant.domain.Result;
import com.gscitysfy.cus.drain.modules.inspection.entity.DrainInspectionRlTrack;
import com.gscitysfy.cus.drain.modules.inspection.service.IDrainInspectionRlTrackService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author Administrator
 * @since 2022-10-14 15:00:46
 */
@RestController
@RequestMapping("/inspection/track")
@Tag(name = "巡检轨迹相关接口")
public class DrainInspectionRlTrackController {

    @Resource
    private IDrainInspectionRlTrackService trackService;


    /**
     * 上传巡检轨迹点位
     * @param track
     * @return
     */
    @PostMapping("/uploadTrack")
    @Operation(summary = "上传巡检轨迹点位")
    @Parameters({
            @Parameter(required = true, name = "cmJobId", description = "巡检任务id"), @Parameter(required = true, name = "cmTrackLat", description = "维度"),
            @Parameter(required = true, name = "cmTrackLng", description = "经度"), @Parameter(required = false, name = "cmTrackFlag", description = "轨迹分段标识"),
    })
    public Result<Boolean> uploadTrack(@RequestBody DrainInspectionRlTrack track){
        return trackService.uploadTrack(track);
    }

    /**
     * 获取巡检中用户位置信息
     * @return
     */
    @GetMapping("/getInspectionPersonPoints")
    @Operation(summary = "获取巡检中用户位置信息")
    public Result<List<DrainInspectionRlTrack>> getInspectionPersonPoints(){
        return trackService.getInspectionPersonPoints();
    }




}
